package com.itheima.d4_proxy;

public class Demo1 {
    public static void main(String[] args) {
        BaoQiang baoQiang = new BaoQiang();
        Star songJiJi = new SongJiJi(baoQiang);
        songJiJi.liveShow(1000);
        songJiJi.sleep();
    }
}
class SongJiJi implements Star{
    BaoQiang baoQiang ;
    public SongJiJi(BaoQiang baoQiang){
        this.baoQiang = baoQiang;
    }
    @Override
    public double liveShow(double money) {
        System.out.println("松季吉收了"+money+"元");
        double baoqiangmoney = money * 0.8;
        System.out.println("松季吉给宝强"+baoqiangmoney+"元");
        return baoqiangmoney;
    }

    @Override
    public void sleep() {
        System.out.println("松季吉订酒店");
        baoQiang.sleep();
        System.out.println("松季吉退房");

    }
}
class BaoQiang implements Star{
    @Override
    public double liveShow(double money) {
        System.out.println("宝强赚了"+money+"元");
        return money;
    }

    @Override
    public void sleep() {
        System.out.println("宝强睡了一觉");

    }
}
interface Star{
    double liveShow(double money);
    void sleep();
}